package com.niiwoo.activity.stage.enums.invite;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Desc:
 * Create by scrawl on 2018/3/23
 */
@Getter
@AllArgsConstructor
public enum InviteRewardWayEnum {
    // 奖励方式（1.借款，2投资，3大礼包）
    BORROW((byte) 1, "借款"),
    INVEST((byte) 2, "投资"),
    GIFT_PACKS((byte) 3, "大礼包");

    private byte value;
    private String desc;

    public static InviteRewardWayEnum enumOf(Byte value) {
        for (InviteRewardWayEnum typeEnum : values()) {
            if (typeEnum.value == value) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("InviteRewardWayEnum:" + value);
    }
}
